home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / SML⁄NJ 93+ / Documentation / examples / textbooks / four_lectures / build5.sml < prev    next >
Encoding:
Text File  |  1995-12-30  |  1.3 KB  |  57 lines  |  [TEXT/R*ch]

  1. (* build5.sml *)
  2.  
  3.                (* building the system *)
  4.  
  5. (*use "lib.sml";
  6.   use "interp5.sml";
  7.   use "parser.sml";*)
  8.  
  9. structure List = List()
  10. and Print = Print();
  11.  
  12. structure Expression= 
  13.   Expression(structure Print= Print
  14.              structure List = List);
  15.  
  16. structure Parser= Parser(Expression);
  17.  
  18. structure Env = Environment();
  19.  
  20. structure Value = Value(structure Env= Env
  21.                         structure Exp = Expression
  22.                         structure Print= Print);
  23.  
  24. structure Evaluator= 
  25.    Evaluator(structure Expression= Expression
  26.              structure Env = Env        
  27.              structure Value = Value);
  28.  
  29.  
  30.  
  31. structure Ty = Type(structure List = List
  32.                     structure Print = Print); 
  33.  
  34. structure Unify = Unify(Ty);
  35.  
  36. structure TE =
  37.   TypeEnv(structure Type = Ty
  38.           structure E = Environment()
  39.           structure List = List);
  40.  
  41.  
  42. structure TyCh= 
  43.   TypeChecker(structure Ex = Expression
  44.               structure Ty = Ty
  45.               structure Unify= Unify
  46.               structure TyEnv = TE
  47.               structure List = List);
  48.  
  49. structure Interpreter=
  50.   Interpreter(structure Ty= Ty
  51.               structure Value = Value
  52.               structure Parser = Parser
  53.               structure TyCh = TyCh
  54.               structure Evaluator = Evaluator);
  55.  
  56. open Interpreter;
  57.